﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Game
{
    /*-------------------------------------------------------------------------
    | GameScene:
    | ------------
    | Game Scene
    |---------------------------------------------------------------------------*/
    public class WorldScene : PhysicScene
    {
        private List<Entity> mEntities = new List<Entity>();

        public WorldScene(IDK.Engine engine)
            : base(engine)
        {
        }

        public void AddEntity(Entity entity)
        {
            mEntities.Add(entity);
        }

        public override void OnUpdate(Events.ProcessSceneUpdate evnt)
        {
            //setup current scene
            evnt.CurrentScene = this;
            //can we simulation game logic?
            if (Pause == false)
            {
                base.OnUpdate(evnt);
            }

            //update other enitities (system, camera, etc)
            foreach (Entity it in mEntities)
            {
                it.OnUpdate(evnt);
            }

            //update techniques
            Technique.Update(evnt);
            //remove it
            evnt.CurrentScene = null;
        }

        public IDK.Camera Camera
        {
            get;
            set;
        }

        public RenderTechnique.OutputTechnique Technique
        {
            get;
            set;
        }
    }
}
